<template>
    <el-container class="layout-container-demo" style="height: 100%">
        <el-aside width="200px">
            <el-scrollbar>
                <el-menu :default-openeds="['1']" 
                class="el-menu-vertical-demo"
                :router="true">
                    <el-sub-menu index="1">
                        <template #title>
                           <el-icon><Menu /></el-icon>作业配置
                        </template>
                        <el-menu-item-group>
                            <el-menu-item :index="'/taskWork'">作业配置</el-menu-item>
                            <el-menu-item :index="'/taskStatus'">作业状态</el-menu-item>
                            <el-menu-item index="2-2">补录数据</el-menu-item>
                            <el-menu-item index="2-2">服务器日志</el-menu-item>
                        </el-menu-item-group>
                    </el-sub-menu>
                    <el-sub-menu index="2">
                        <template #title>
                            <el-icon><setting /></el-icon>资源配置
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="3-1">服务器配置</el-menu-item>
                            <el-menu-item index="3-2">文件组配置</el-menu-item>
                            <el-menu-item index="3-2">文件明细配置</el-menu-item>
                            <el-menu-item index="3-2">处理器配置</el-menu-item>
                            <el-menu-item index="3-2">入库规则配置</el-menu-item>
                            <el-menu-item index="3-2">全局变量配置</el-menu-item>
                            <el-menu-item index="3-2">解压参数配置</el-menu-item>
                            <el-menu-item index="3-2">下载记录配置</el-menu-item>
                            <el-menu-item index="3-2">API配置</el-menu-item>
                            <el-menu-item index="3-2">SQL配置</el-menu-item>
                            <el-menu-item index="3-2">Option 2</el-menu-item>
                        </el-menu-item-group>
                    </el-sub-menu>
                    <el-sub-menu index="3">
                        <template #title>
                            <el-icon><setting /></el-icon>监控任务
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="3-1">调度配置</el-menu-item>
                            <el-menu-item index="3-2">任务管理</el-menu-item>
                        </el-menu-item-group>
                    </el-sub-menu>
                    <el-sub-menu index="4">
                        <template #title>
                            <el-icon><setting /></el-icon>数据权限配置
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="3-1">权限配置</el-menu-item>
                            <el-menu-item index="3-2">数据资源</el-menu-item>
                        </el-menu-item-group>
                    </el-sub-menu>
                </el-menu>
            </el-scrollbar>
        </el-aside>

        <el-container>
            <el-header style="text-align: right; font-size: 12px">
                <div class="toolbar">
                    <el-dropdown>
                        <el-icon style="margin-right: 8px; margin-top: 1px"
                        ><setting
                        /></el-icon>
                        <template #dropdown>
                            <el-dropdown-menu>
                                <el-dropdown-item>View</el-dropdown-item>
                                <el-dropdown-item>Add</el-dropdown-item>
                                <el-dropdown-item @click="quit">退出登录</el-dropdown-item>
                            </el-dropdown-menu>
                        </template>
                    </el-dropdown>
                    <span v-bind:textContent="userName"></span>
                </div>
            </el-header>

            <el-main>
                <!-- 路由占位符 -->
                <router-view></router-view>
            </el-main>
        </el-container>
    </el-container>
</template>

<script lang="ts">
import homeController from '../controller/homeController';
export default homeController;
</script>

<style scoped>
.layout-container-demo .el-header {
    position: relative;
    background-color: red;
    color: white;
}

.layout-container-demo .el-header .toolbar .el-dropdown .el-icon {
    color: white;
}
.layout-container-demo .el-aside {
    color: var(--el-text-color-primary);
    background: var(--el-color-primary-light-8);
}
.layout-container-demo .el-menu {
    border-right: none;
}
.layout-container-demo .el-main {
    padding: 0;
}
.layout-container-demo .toolbar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    right: 20px;
}

.layout-container-demo .el-menu{
    height: 100%;
}
:deep(.el-scrollbar__view){
    height: 100%;
}
</style>
